package pub.fjf.http;

import java.util.Date;

public class HttpResponseMode {
	private static final String[] week = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
	@SuppressWarnings("deprecation")
	private static String GMTDate() {
		StringBuffer gmt = new StringBuffer();
		Date d = new Date();
		gmt.append(week[d.getDay()]);
		gmt.append(", ");
		gmt.append(d.toGMTString());
		return gmt.toString();
	}

	public static void basePackage(HttpResponse resp) {
		resp.setProtocol("HTTP");
		resp.setVersion("1.1");
		resp.setKeyValue("X-Powered-By", "Express");
		resp.setKeyValue("Server", "JerryRat-2.0");
		resp.setKeyValue("Date", GMTDate());
	}
}
